<?php
class CMS_Models_Banner extends Zend_Db_Table_Abstract
{
  protected $_name = "banner";	
	
  public function __construct( )
  {
    parent::__construct(array('table' => $this->_name));
  }
/**
 * Obtiene todos los banners
 * @return Zend_Db_Rowset_Abstract
 */
  public function getAll()
  {
    return $this->fetchAll();
  }
  /**
   * Obtiene todos los banners habilitados
   * @return Zend_Db_Rowset_Abstract
   */
  public function getEnabledBanners()
  {
    return $this->fetchAll("enabled = 1");
  }
  /**
   * Obtiene un banner dado un id
   * @param $id
   * @return Zend_Db_Row_Abstract
   */	
  public function getBannerById($id)
  {
    return $this->fetchRow("id = '$id' ");
  } 

}
